
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=utf-8" %>
<%@page import="controller.Controller"%>
<%@page import="sessionMenegment.SessionMgr"%>
<%@ page import="java.util.*,dataBase.*"%>
<%@page import="language.LangFactory"%>
<%@page import="language.LangIntrf"%>
<%
	LangFactory langFactory= new LangFactory();
	String langName = request.getParameter("lang");

	LangIntrf lang =null;
	if(langName!=null){
		lang = langFactory.getLang(request.getParameter("lang"));
		session.setAttribute("lang",langName);
	}
	else
		lang = langFactory.getLang((String)session.getAttribute("lang"));
	String langSign = lang.getLang();
	
	
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Synca</title>
<link rel="icon" href="images/synca.png" type="image/x-icon"/> 
<link rel="shortcut icon" href="images/synca.png" type="image/x-icon"/>
<link href="try7.css" rel="stylesheet" type="text/css" />
<link href="rating/jquery.rating.css" rel="stylesheet" type="text/css" />

<!--[if IE]>

<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColHybLtHdr #sidebar1 { padding-top: 30px; }
.twoColHybLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
</style>
<![endif]-->

<script type="text/javascript" src="rating/jquery.js"></script>
<script type="text/javascript" src="rating/jquery.MetaData.js"></script>
<script type="text/javascript" src="rating/jquery.rating.js"></script>

<%
	String bizKey = request.getParameter("bizKey");
	if(bizKey==null || bizKey.equals(""))
		response.sendRedirect("home.jsp");
	Business biz = Controller.getInstance().keyToBusiness(bizKey);
	//Business biz = Controller.getInstance().getBiz(bizKey);


	    	String border = biz.getBorderColor();
        	String background = biz.getBackground();
        	String messageBG = biz.getSecBackground();
         	
        	if (border!=null && background!=null && messageBG!=null ){
  %>
        
        <style type="text/css">
        	
        	.twoColHybLtHdr #container {
        		background-color: <%=background%>;
        	}
        	.twoColHybLtHdr #header {
        		background-color: <%=messageBG%>;
        		border-bottom: solid 2px <%=border%>;
        	}
        	.twoColHybLtHdr #mainContent{
        		background-color: <%=background%>;
        	}
        	.twoColHybLtHdr #footer {
        		background-color: <%=messageBG%>;
        		border-top: solid 2px <%=border%>;
        	}
        </style>
        <%} %>
<script>
$(function(){
	 $('.star').click(function(){
		 alert($('input[name=vote]:checked').val());
		 //$.get("addVote?biz=<%=biz.getBizName()%>&",function(data){});
	 });
	});
</script>

</head>

<body class="twoColHybLtHdr">

<div id="container">
  <div id="header">
		   		

            
</div>
  
  <div id="mainContent">
    
    	<table cellpadding="10px" dir="<%=lang.getDirection()%>">	
    		<tr>
    			<td rowspan="2">
    			<%if (biz.getLogoPic()!=null){ %>
    				<img src="showImage?bizKey=<%=biz.getKey().getId() %>" width="150"/>
				<% }else{ %>
					<img src="/images/tempLogo.png" width="150" border="1"/>
				<%} %>
    			</td>
    			<td valign="bottom" align="<%=lang.getAlign()%>"><b><h1><%=biz.getBizName() %></h1></b></td>
    			<td rowspan="6" width="400px" align="<%=lang.getNotAlign()%>">
    				<%for(int i=0;i<biz.getAds().size();i++){ %>
    					<img src="showImage?bizKey=<%=biz.getKey().getId() %>&id=<%=i %>" alt="" width="130px"/><br/><br/>
    				<%} %>
				</td>
    		</tr>
    		<tr>
    			<td valign="top" align="<%=lang.getAlign()%>">
    			<%=biz.getVotesAvg() %>
    			<%
    				double voteAvg = biz.getVotesAvg();
    				int check = (int)Math.floor(voteAvg);
    				for(int i=1;i<6;i++){
    					if(i==1){
    						if(check==1){
    			%>
    			
	    						<input class="star required" type="radio" name="vote" value="<%=i %>" checked="checked" disabled="disabled"/>
	    		<%			}
    						else{
    			%>
    							<input class="star required" type="radio" name="vote" value="<%=i %>" disabled="disabled"/>
    			<%		 	}
    					}
    					else if(check==i){  						
    			%>
							<input class="star" type="radio" name="vote" value="<%=i %>" checked="checked"disabled="disabled"/>
				<%		} else{%>
							<input class="star" type="radio" name="vote" value="<%=i %>" disabled="disabled"/>
				<%		} %>
				<%} %>
				</td>
    		</tr>
    		<tr><td><br/></td></tr>
    		<tr>
    			<td align="<%=lang.getAlign()%>"><%=lang.getPHONE_TABLE_LABEL() %></td>
    			<td><%=biz.getPhoneNumber().getNumber() %></td>
    		</tr>
    		<tr>
    			<td align="<%=lang.getAlign()%>"><%=lang.getEMAIL_TABLE_LABEL() %></td>
    			<td><%=biz.getEmail().getEmail() %></td>
    		</tr>
    		<tr valign="top">
    			<td align="<%=lang.getAlign()%>"><%=lang.getBUSINESS_WEBSITE_LABEL() %></td>
    			<td><a href="<%=biz.getWebsite() %>"><%=biz.getWebsite() %></a></td>
    		</tr>
    	</table>
    
				

</div>
	<br class="clearfloat" />
	
</div>
<div id="footer">
    <a href="businessPage.jsp?lang=he&bizKey=<%=bizKey%>"><img src="images/hebrew.gif" width="30px" style="float: left; margin-top: 0.5%; margin-left: 0.5%;"/></a>
	<a href="businessPage.jsp?lang=en&bizKey=<%=bizKey%>"><img src="images/english.gif" width="30px" style="float: left; margin-top: 0.5%;margin-left: 0.5%;"/></a>
    <p><%=lang.getCOPY_RIGHT_LABEL() %></p>
    
 </div>
</body>
</html>
